# CMake 最低版本号要求
cmake_minimum_required(VERSION 2.8)
#-------------debug编译 取消注释----------------------
#SET(CMAKE_BUILD_TYPE "Debug")  
#SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")  
#SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
#-------------debug编译----------------------
# 项目名称
project(servermain)
add_definitions(-std=c++11)

link_directories(/usr/lib64/mysql/)
# 添加子目录

include_directories(connection)
include_directories(Net)
include_directories(epoll)
include_directories(config)
include_directories(include_)
include_directories(header)
include_directories(MemoryPool)
include_directories(socket)
include_directories(threadPool)
include_directories(mysql)
include_directories(md5)
include_directories(public)
include_directories(Lock)
include_directories(Worker)
include_directories(Timer)
include_directories(json/json)
include_directories(json)
include_directories(curl)
include_directories(./)

# 将当前目录所有源文件保存在变量DIR_SRCS中
aux_source_directory(./epoll DIR_SRCS)
aux_source_directory(./connection DIR_SRCS)
aux_source_directory(./Net DIR_SRCS)
aux_source_directory(./Worker DIR_SRCS)
aux_source_directory(./config DIR_SRCS)
aux_source_directory(./MemoryPool DIR_SRCS)
aux_source_directory(./signal DIR_SRCS)
aux_source_directory(./json DIR_SRCS)
aux_source_directory(./socket DIR_SRCS)
aux_source_directory(./threadPool DIR_SRCS)
aux_source_directory(./Timer DIR_SRCS)
aux_source_directory(./mysql DIR_SRCS)
aux_source_directory(./md5 DIR_SRCS)
aux_source_directory(./public DIR_SRCS)
aux_source_directory(./Lock DIR_SRCS)
aux_source_directory(./curl DIR_SRCS)
aux_source_directory(./ DIR_SRCS)
# 指定生成目标，将DIR_SRCS变量的所有源文件生成一个名为demo2的可以执行文件
add_executable(servermain ${DIR_SRCS})
#link_directories (${CMAKE_SOURCE_DIR} /)
target_link_libraries(servermain dl)
target_link_libraries(servermain pthread)
target_link_libraries(servermain curl)
link_directories(/usr/lib64/mysql)


target_link_libraries(servermain  mysqlclient)
